package com.example.labtest.dao;

import com.example.labtest.domain.Student;
import com.example.labtest.domain.Student_info;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * 学生综合信息仓库接口
 */
public interface StudentRepository extends JpaRepository<Student,Long> {

    //@Query("select s from student as s where s.sname like %?1%")
    List<Student> findBySname(String sname);

    public Page<Student>findBySnameLike(String sname, Pageable pageable);

    @Query("select s from student_info1 s where s.sname = ?1")
    public Page<Student>findBySname(String sname, Pageable pageable);

    //定义方法
    public List<Student>findBySnameAndPsw(String sname,String psw);

}
